{% if form is not null %}
{% if form_type is not null and form_type != 'edit' %}
<form id="registerForm" action="{{ path('s3_sample1_connetion_save') }}" method="post">
{% else %}
<form class="edit-form" id="registerForm" action="{{ path('s3_sample1_connetion_update', {'id' : id}) }}" method="post">
{% endif %}
    <div class="field-error">{{ form_errors(form) }}</div>
    {# {{ form_row(form.location) }} #}
    <p class="row">
        {{ form_label(form.accountid, 'Account Id') }}
        {{ form_widget(form.accountid, {'attr': {'class' : 'sizeB'}} ) }}	
    </p>
    <div class="field-error">{{ form_errors(form.accountid) }}</div>    	
    {# {{ form_row(form.status) }} #}
    <p class="row">
        {{ form_label(form.providerid, 'Provider Id') }}		
        {{ form_widget(form.providerid, {'attr': {'class' : 'sizeB'}}) }}        
    </p>
    <input type="file" class="file-uploader"/>
    {# Hydrated by javascript #}
    <div class="file-uploader"></div>
    
    <div class="field-error">{{ form_errors(form.providerid) }}</div>			
    <p class="row">
	{{ form_label(form.accesstoken, 'Access Token') }}		
        {{ form_widget(form.accesstoken, {'attr': {'class' : 'access-token'}}) }}        
    </p>
    <div class="field-error">{{ form_errors(form.accesstoken) }}</div>			    
    <p class="row">
	{{ form_label(form.secret, 'Secret') }}		
        {{ form_widget(form.secret, {'attr': {'class' : 'secret'}}) }}        
    </p>
    <div class="field-error">{{ form_errors(form.accesstoken) }}</div>			    
    <p class="row">
	{{ form_label(form.refreshtoken, 'Refresh Token') }}		
        {{ form_widget(form.refreshtoken, {'attr': {'class' : 'secret'}}) }}        
    </p>
    <div class="field-error">{{ form_errors(form.refreshtoken) }}</div>			    
    <p class="row">
	{{ form_label(form.provideraccountid, 'Provider Account Id') }}		
        {{ form_widget(form.provideraccountid, {'attr': {'class' : 'secret'}}) }}        
    </p>
    <div class="field-error">{{ form_errors(form.refreshtoken) }}</div>			    
    {{ form_rest(form) }}
    <p class="row">
    <label> &nbsp;</label>
    <button>Submit</button>
    </p>    
</form>
<script type="text/javascript">
$(function() {
    new PunkAveFileUploader({ 
        'uploadUrl': {{ path('upload', { editId: id }) | json_encode | raw }},
        'viewUrl': {{ asset('/uploads/tmp/attachments/' ~ id) | json_encode | raw }},
        'el': '.file-uploader',
        'existingFiles': {{ existingFiles | json_encode | raw }},
        'delaySubmitWhileUploading': '.edit-form'
    });
});
</script>
{% endif %}            